Everything Totally Explained


Ask & we'll explain, totally!
Internet socket
Totally Explained


  NEW! All the latest news in the worlds of computer gaming, entertainment, the environment,  
finance, health, politics, science, stocks & shares, technology and much, much, more.  


View this entry using RSS

Everything about Internet Socket totally explained

An Internet socket (or commonly, a socket or network socket), is an end-point of a bidirectional communication link that's mapped to a computer process communicating on an Internet Protocol-based network, such as the Internet. A socket is an interface between an application process or thread (child process) and the TCP/IP protocol stack provided by the operating system. An Internet socket is identified by the operating system as a unique combination of the following:
  • Protocol (TCP, UDP or raw IP)
  • Local IP address
  • Local port number
  • Remote IP address (Only for established TCP sockets)
  • Remote port number (Only for established TCP sockets)
The operating system is forwarding incoming IP data packets to the corresponding application process by extracting the above socket address information from the IP, UDP and TCP headers.
   A communicating local and remote socket are called a socket pair.
   A somewhat simplified definition occurring in the literature follows: "The combination of an IP address and a port number is referred to as a socket." See also RFC 147 for the original definition of socket as it was related to the ARPA network in 1971. The netstat -an command-line tool shows a list of all sockets that are currently defined by the operating system. The netstat -b command shows a list of which socket that was created by what application program. For a listening TCP socket, the remote address presented by netstat may be denoted 0.0.0.0 and the remote port number 0.

Socket types and the client-server model

There are three Internet socket types:
  • Datagram sockets, which use UDP
  • Stream sockets, which use TCP
  • Raw sockets (or Raw IP sockets), where the transport layer is bypassed, and the packet headers are not stripped off, but are accessible to the application. Application examples are ICMP, IGMP and OSPF. (There are also non-Internet sockets, implemented over other transport protocols, such as SNA (External Link). See also Unix domain sockets (UDS), for internal inter-process communication.) A TCP socket may be in listening state, for example a server process, waiting for remote clients to take initiative to the communication. A TCP socket may also be in established state, meaning that a socket-to-socket virtual connection or virtual circuit (VC), also known as a TCP session, is established with a remote client, providing a duplex byte stream. Other possible TCP socket states presented by the netstat command are Syn-sent, Syn-Recv, Fin-wait1, Fin-wait2, Time-wait, Close-wait and Closed. (External Link) A server may create several concurrently established TCP sockets with the same local address and port number, each mapped to its own server child-process and serving its own client process. These are treated as different sockets by the operating system, since the remote client address and/or socket numbers are different.
       A UDP socket may not be in established state, since UDP is connectionless. Netstat doesn't show the state of a UDP socket. A UDP server doesn't create new child-processes for every concurrently served client, but the same process is processing incoming data packets from all remote clients iteratively through the same local UDP socket. This implies that UDP sockets are not identified by the remote address, but only by the local address.

    Implementation issues

    Sockets are usually implemented by an API library such as Berkeley sockets, first introduced in 1983, or Winsock. Other socket API implementations exist, such as the STREAMS-based Transport Layer Interface (TLI). From the operating system point of view, a socket is an object, for example an instance of a class.
       Developing application programmes that utilizes this API is called socket programming or network programming.
       Network equipment such as routers and switches traditionally don't deal with sockets. However, stateful network firewalls and Network Address Translation proxy servers automatically keep track of all active socket pairs, UDP as well as TCP, based on certain time-out settings. Also in fair queuing, and in layer 3 switching, traffic flows may be identified by extracting information about the socket pairs.

    Further Information

    Get more info on 'Internet Socket'.


    External Link Exchanges

    Do you know how hard it is to get a link from a large encyclopaedia? Well we're different and will prove it. To get a link from us just add the following HTML to your site on a relevant page:

      <a href="http://internet_socket.totallyexplained.com">Internet socket Totally Explained</a>

    Then simply click through this link from your web page. Our crawlers will verify your link, extract the title of your web page and instantly add a link back to it. If you like you can remove the words Totally Explained and embed the link in article text.
       As long as your link remains in place, we'll keep our link to you right here. Please play fair - our crawlers are watching. Your site must be closely related to this one's topic. Any kind of spamming, dubious practises or removing the link will result in your link from us being dropped and, potentially, your whole site being banned.



  • Copyright © 2007-8 totallyexplained.com | Licensed under the GNU Free Documentation License | Site Map
    This article contains text from the Wikipedia article Internet socket (History) and is released under the GFDL | RSS Version